#include "ProgramManager.hpp"
#include "CallingContext.hpp"
#include "CallingInstance.hpp"
#include "Variable.hpp"
#include "IdentificatorTable.hpp"

Variable::Variable( const std::string& name )
{
  CallingContext *cc;

  index = ProgramManager::addIdentificator(name);
  _value._class=CE_MEMORY;
  cc=ProgramManager::getCurrentContext();
	if ( cc->getTypeOf ( index )._base == TYPE_ERROR )
		printf ( "\nArggg!!!! : %d\n", index );
  _value._type = cc->getTypeOf(index);
}

void Variable::compute ()
{
	LOGFUNCTION(IEXEC_LOG);
  _value._value._vaddress= ProgramManager::getCurrentInstance()->getAddress(index);
}

void Variable::display ( const unsigned int shift) const
{
  std::cout << "var::" << index;
}
